The present invention disclosed herein relates to data storage apparatus and more particularly, to a data storage apparatus equipped with a nonvolatile memory as a write buffer.
A data storage apparatus such a hard disc drive (HDD) generally employs a semiconductor memory as a write buffer. A typical write buffer for a data storage apparatus may employ, for example, a volatile memory such as a dynamic random access memory (DRAM). In most cases, the write buffer is usually designed to minimize the time required for scanning a disc head by rearranging data write requests from a host. In a write buffer that uses a volatile memory such as a DRAM, data stored in the write buffer is lost when the power supply is interrupted or suspended. Because of this, write data transferred from the host should only be stored for a short time in a write buffer that uses volatile memory.
To extend the amount of time data can be stored, a write buffer may be implemented with a nonvolatile memory such a flash memory. In this case, it is possible to buffer data for a relatively long time because the flash memory is able to retain data stored therein, even without a power supply. Therefore, data provided from a host are able to be preserved in the write buffer even if the power supply to the storage medium such a disc is interrupted. When a nonvolatile memory is used as the write buffer, it is possible to reduce the power consumption of the storage apparatus by limiting the amount of time spend driving a spindle motor that consumes most of the power used by an HDD. And, by fixing the head media to a stable position of the disc, it is possible to reduce problems due to shock or vibration caused by moving or carelessly handling the system. Further, it helps improve endurance by reducing operating time of mechanical elements in the disc.
FIG. 1 is a block diagram showing a computer system having a data storage apparatus. Referring to FIG. 1, the computer system includes a data storage apparatus 1 and a host 7. For example, the host 7 may include mobile a computing apparatus such as a notebook computer. The data storage apparatus 1 is comprised of a write buffer 2, a disc 3, a spindle motor 4 for driving the disc 3, and a controller 8. The disc 3, as shown in FIG. 1, includes head media 5 and a magnetic storage medium 6. The controller 8 is configured to regulate data transmission between the disc 3 and the write buffer 2, and between the disc 3 and the host 7.
When the data storage apparatus 1 receives a request for a data write operation from the host (e.g., a notebook computer) 7, data to be written (hereinafter, referred to as ‘write data’) are stored in the write buffer 2, which includes a nonvolatile memory, under regulation by the controller 3 as long as there is unused space for storage in the write buffer 2. If there is enough space in the write buffer 2, the data does not need to be written to the disc 3. Thus, it is permissible to interrupt the power supplied to the spindle motor 4 that drives the disc 3, and to improve efficiency by reducing power consumption by suspending the spindle motor 4 for a long time. It is possible to further reduce power consumption by interrupting the power supply to the whole body of the magnetic storage medium 6. And, by displacing the head media 5 from the magnetic storage medium 6 while suspending the spindle motor 4 for a long time, it is possible to reduce the probability of problems due to shock or vibration caused by moving or carelessly treating the system.
When the write buffer 2 is implemented with a nonvolatile memory such as a flash memory, it may be managed in the following manner. In general, a flash memory has two operational characteristics: sequentially writing data in a memory block; and inhibiting data to be overwritten in the same locations that have already been written. The write data transferred from the host 7 are sequentially written in the write buffer 2 in the order of requested time points. For instance, as illustrated in FIG. 2, as successive requests for data writing operations are received from the host 7, it reduces the volume of unused space in the write buffer 2. If the unused space is insufficient in the write buffer 2, data is moved from the write buffer 2 into the storage medium so as to flush or empty the write buffer 2. This is referred to as a ‘buffer flush operation.’ During the buffer flush operation, power must be supplied to the disc 3 so as to store data from the write buffer 2 to the disc 3.
If data on the disc 3, which are assigned to the same addresses as the write data transferred from the host 7, have been already written in the write buffer 2, newly requested write data are sequentially written in the write buffer 2 and previously written data, which has been written to the disk, are regarded as old data and designated as invalid (or nullified).
The invalid (or nullified) data are a result of the operational characteristic of the flash memory, i.e., the old data are inhibited (cannot be overwritten) at the same positions in the flash memory. As illustrated in FIG. 3A, if there is a request from the host 7 for a writing operation for data which are assigned to the same addresses with the data previously written in the write buffer 2, new write data transferred from the host 7 are sequentially written in the write buffer 2, and the previously-written data become invalid (see the hatched portions in FIGS. 3A and 3B) because it is not permissible to overwrite data in the flash memory. A data write request to the same address may be frequent for metadata and the file system of the host 7. Thus, when there are frequent data write requests to the same addresses over time, as shown in FIG. 3B, the invalid data appear in large numbers in various positions in the flash memory that makes up the write buffer 2.
As mentioned above, if data, including valid and invalid data, occupy a large amount of space in the write buffer 2, the write buffer 2 is only left with a small volume of unused space. In this case, it is necessary to move valid data to the disc 3 by way of the buffer flush operation as mentioned above to assure unused space for new write data in the write buffer 2.
However, as stated above, the buffer flush operation inevitably consumes power to actuate the spindle motor 4. Such frequent buffer flush operations increase the rate of power consumption by the data storage apparatus 1. Therefore, it reduces the recharge interval of a battery used for supplying power to a mobile computing system. This reduces the battery operating time and degrades the endurance of the data storage apparatus because of shock or vibrations due to movement.
As a result, a new technique is needed for managing the write buffer in order to lengthen the recharge interval of the battery and to improve the endurance of the data storage apparatus.